package cloud.xlh.middleware_manage.controller;

import cloud.xlh.middleware_manage.domin.ConnectionInfo;
import cloud.xlh.middleware_manage.service.OperateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : xlh_osms
 * @ Author: XuLeHuang
 * @ Date: 2023/2/28 13:00
 * @ Description:
 */
@RestController
@RequestMapping("middleWareCRUDController")
public class MiddleWareCRUDController {

    @Autowired
    private OperateService operateService;
    private final static int l = 65288;
    private final static int r = 65289;

    /*@RequestMapping("/operate")
    public JSONObject operate(@RequestBody MiddleWareOperateInfo middleWareOperateInfo) {


        String name = "(黎明)";
        String name1 = (char) l + "黎明" + (char) r;

        return operateService.operate(middleWareOperateInfo);
    }*/

    @RequestMapping("/checkKeepAlive")
    public Boolean checkKeepAlive(@RequestBody ConnectionInfo connectionInfo) {
        return operateService.checkKeepAlive(connectionInfo);
    }

    public static void main(String[] args) {
        String name = "(黎明)";
        String name1 = (char) l + "黎明" + (char) r;
        System.out.println(name);
        System.out.println(name1);

        //new StringJoiner((char) l , "" , (char) r);
    }
}
